import { createStore } from 'vuex'

const MEMBER ="MEMBER";

export default createStore({
  state: {
    member : window.SessionStorage.get(MEMBER) || {}
  },
  getters: {
  },
  mutations: {
    setMember (state , _member){  //state是系统自带的 不用传参
      state.member = _member;
      window.SessionStorage.set(MEMBER,_member);
    },
    clearMember(state){  //将退出登录的处理进行封装
      state.member = {};
      window.sessionStorage.removeItem(MEMBER);
    }
  },
  actions: {
  },
  modules: {
  }
})
